package apiroutes

import (
	"dataaysn/internal/service"

	"github.com/gin-gonic/gin"
)

func RegisterDatasourceRoutes(r *gin.Engine, datasourceService *service.DataSourceService) {
	dataSourceGroup := r.Group("/api/data-sources")
	{
		dataSourceGroup.POST("", datasourceService.CreateDataSource)
		dataSourceGroup.GET("", datasourceService.ListDataSources)
		dataSourceGroup.GET("/:id", datasourceService.GetDataSource)
		dataSourceGroup.PUT("/:id", datasourceService.UpdateDataSource)
		dataSourceGroup.DELETE("/:id", datasourceService.DeleteDataSource)
		dataSourceGroup.POST("/test", datasourceService.TestConnection)
	}
}
